Skip to content

bugfix(w3dmouse): Prevent race conditions and use-after-free during shutdown#488

Merged
x64-dev merged 1 commit intomainfrom
seer/fix/w3dmouse-thread-safety
May 7, 2026
Merged

bugfix(w3dmouse): Prevent race conditions and use-after-free during shutdown#488
x64-dev merged 1 commit intomainfrom
seer/fix/w3dmouse-thread-safety

Conversation

@seer-by-sentry
Copy link
Copy Markdown

@seer-by-sentry seer-by-sentry Bot commented May 7, 2026

Fixes CLIENT-1A0. The issue was that: Mouse thread accesses TheMouse object after main thread deletes it, causing use-after-free during Windows cursor API call.

  • Added a critical section to protect the 'TheMouse' global pointer dereference within the mouse update thread, preventing potential race conditions if 'TheMouse' is destroyed concurrently.
  • Moved the 'thread.Stop()' call to the beginning of the 'W3DMouse' destructor to ensure the update thread is fully stopped before any D3D/W3D assets it might be using are freed, preventing use-after-free scenarios.

This fix was generated by Seer in Sentry, triggered by x64-dev. 👁️ Run ID: 13725688

Not quite right? Click here to continue debugging with Seer.

@seer-by-sentry seer-by-sentry Bot requested a review from x64-dev May 7, 2026 21:16
@x64-dev x64-dev marked this pull request as ready for review May 7, 2026 21:17
@x64-dev x64-dev merged commit 089d92e into main May 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant